﻿using Mes.Domain.BoundedContext.EntityBase;

namespace Mes.Domain.BoundedContext.Entities.Operations
{
    public class Oper : NoIdEntityBase
    {
        public Oper() { }
        public Oper(string processId, string operId, string? operDesc, bool firstOper, bool finalOper, int displaySeq, double? operCost,
            string? operType, double deviationAbove, double deviationBelow, string? notes, DateTime lastEditAt)
        {
            Process_Id = processId;
            Oper_Id = operId;
            Oper_Desc = operDesc;
            First_Oper = firstOper;
            Final_Oper = finalOper;
            Display_Seq = displaySeq;
            Oper_Cost = operCost;
            Oper_Type = operType;
            Deviation_Above = deviationAbove;
            Deviation_Below = deviationBelow;
            Notes = notes;
            Last_Edit_At = lastEditAt;
        }

        public string Process_Id { get; set; } = string.Empty;

        public string Oper_Id { get; set; } = string.Empty;

        public string? Oper_Desc { get; set; } = null;

        public double? Def_Reject_Rate { get; set; } = null;

        public bool First_Oper { get; set; } = false;

        public bool Final_Oper { get; set; } = false;

        public int Display_Seq { get; set; } = 0;

        public bool Check_Inv { get; set; } = false;

        public int? Sched_To_Ent_Id { get; set; }

        public string? Oper_Type { get; set; } = null;

        public double? Oper_Cost { get; set; } = null;

        public double Deviation_Above { get; set; } = 0.01;

        public double Deviation_Below { get; set; } = -0.01;

        public string? Assoc_File { get; set; } = null;

        public string? Assoc_File_Type { get; set; } = null;

        public string? Rework_Cd { get; set; } = null;

        public string? Notes { get; set; } = null;

        public string? Spare1 { get; set; } = null;

        public string? Spare2 { get; set; } = null;

        public string? Spare3 { get; set; } = null;

        public string? Spare4 { get; set; } = null;

        public string? Last_Edit_Comment { get; set; } = null;

        public string? Last_Edit_By { get; set; } = null;

        public DateTime Last_Edit_At { get; set; } = DateTime.Now;

        public long Mod_Id { get; set; } = 0;

        public int Row_Id { get; set; } = 0;
    }
}
